import { getFormDataFieldsValue } from '@supplier/utils';
import {
  SUPPLIER_CATEGORY_SELECT_LIST,
  METAL_SELECT_LIST,
} from '@supplier/constants/common'
// 签订要求
const SIGNING_REQUIREMENT_OPTIONS = [
  { label: '需签订合同', value: 1 },
  { label: '无强制签订要求', value: 2 },
]
// 签订情况
const SIGNING_CONDITION_OPTIONS = [
  { label: '达标已签订完毕', value: 1 },
  { label: '不签订合同已审批', value: 2 },
]
// 计划签订类型
const SIGNING_TYPE_OPTIONS = [
  { label: '签订合同', value: 1 },
  { label: '不签订合同', value: 2 },
]
// 年度 月度待办 查询条件
const FORM_ITEM_LIST = [
  {
    prop: 'managementAreaId',
    label: '管理区域',
    type: 'managementArea'
  },
  {
    prop: 'belongDepartment',
    label: '归属中心',
    type: 'select',
    filterable: true,
    dict: 233,
  },
  {
    prop: 'supplierCode',
    label: '供应商代码',
    type: 'input'
  },
  {
    prop: 'supplierName',
    label: '供应商名称',
    type: 'input'
  },
  {
    prop: 'businessContact',
    label: '业务对接人',
    type: 'input'
  },
  {
    prop: 'supplierClassify',
    label: '供应商分类',
    type: 'select',
    clearable: true,
    options: SUPPLIER_CATEGORY_SELECT_LIST
  },
  {
    prop: 'supplierNature',
    label: '供应商性质',
    type: 'select',
    clearable: true,
    dict: 232
  },
  /* {
    prop: 'mainCategoryId',
    label: '主营品类',
    type: 'categorySelect'
  }, */
  {
    prop: 'mainCategory',
    label: '主营品类名称',
    type: 'input'
  },
  {
    prop: 'mainCategoryCode',
    label: '主营品类代码',
    type: 'input'
  },
  {
    prop: 'cooperativeClassify',
    label: '合作关系分类',
    type: 'select',
    filterable: true,
    sysDict: 10158
  },
  {
    prop: 'introductionReason',
    label: '引入原因',
    required: true,
    type: 'select',
    sysDict: 10160
  },
  {
    prop: 'checkoutTime',
    label: '结账时间',
    type: 'select',
    clearable: true,
    sysDict: 15
  },
  {
    prop: 'paidType',
    label: '付款方式',
    type: 'select',
    clearable: true,
    sysDict: 10131
  },
  {
    prop: 'checkoutRange',
    label: '结账区间',
    type: 'select',
    clearable: true,
    sysDict: 10133
  },
  {
    prop: 'acceptInvoice',
    label: '是否承兑',
    type: 'select',
    options: METAL_SELECT_LIST
  },
  {
    prop: 'settlementType',
    label: '结算方式',
    type: 'select',
    clearable: true,
    sysDict: 10173
  },
  {
    prop: 'rebate',
    label: '是否返利',
    type: 'select',
    clearable: true,
    dict: 18
  },
  {
    prop: 'purchaseStatus',
    label: '进货状态',
    clearable: true,
    type: 'select',
    dict: 255
  },
  {
    prop: 'contractYear',
    label: '合同签订年度',
    type: 'year',
  },
  {
    prop: 'signingRequirement',
    label: '签订要求',
    type: 'select',
    options: SIGNING_REQUIREMENT_OPTIONS
  },
  {
    prop: 'latestCompletionTime',
    label: '最晚完成时间',
    type: 'date',
  },
  {
    prop: 'signingType',
    label: '计划签订类型',
    clearable: true,
    type: 'select',
    options: SIGNING_TYPE_OPTIONS
  },
  {
    prop: 'contractStandard',
    label: '合同是否达标',
    clearable: true,
    type: 'select',
    options: METAL_SELECT_LIST
  },
  {
    prop: 'signingConditionName',
    label: '签订情况',
    type: 'input',
    // options: SIGNING_CONDITION_OPTIONS
  },
  {
    prop: 'contractType',
    label: '合同类型',
    type: 'select',
    clearable: true,
    dict: 258
  },
  // contractStartTime contractEndTime
  {
    prop: 'contractTime',
    label: '合同时间',
    clearable: true,
    type: 'datePicker',
  },
]
const FORM_DATA = getFormDataFieldsValue(FORM_ITEM_LIST)

export {
  SIGNING_REQUIREMENT_OPTIONS,
  SIGNING_CONDITION_OPTIONS,
  SIGNING_TYPE_OPTIONS,
  FORM_ITEM_LIST,
  FORM_DATA
}
